package org.chen.common.scene.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

@Data
public class NearbyAttractionQueryDTO {
    
    /**
     * 城市名称（与经纬度二选一）
     */
    @Schema(description = "城市名称（与经纬度二选一）",
            example = "成都",
            defaultValue = "成都",
            requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private String cityName;
    
    /**
     * 纬度（与城市名称二选一）
     */
    @DecimalMin(value = "-90.0", message = "纬度必须在-90到90之间")
    @DecimalMax(value = "90.0", message = "纬度必须在-90到90之间")
    @Schema(description = "纬度（与城市名称二选一）",
            example = "30.578993",
            defaultValue = "30.578993",
            requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private BigDecimal latitude;
    
    /**
     * 经度（与城市名称二选一）
     */
    @DecimalMin(value = "-180.0", message = "经度必须在-180到180之间")
    @DecimalMax(value = "180.0", message = "经度必须在-180到180之间")
    @Schema(description = "纬度（与城市名称二选一）",
            example = "104.072747",
            defaultValue = "104.072747",
            requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private BigDecimal longitude;
    
    /**
     * 搜索半径（公里），默认10公里
     */
    @Min(value = 1, message = "搜索半径不能小于1公里")
    @Max(value = 100, message = "搜索半径不能大于100公里")
    @Schema(description = "搜索半径（公里），默认10公里",
            example = "10",
            defaultValue = "10",
            requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer radius = 10;
    
    /**
     * 页码，从1开始
     */
    @NotNull(message = "页码不能为空")
    @Min(value = 1, message = "页码必须大于0")
    @Schema(description = "页码，从1开始",
            example = "1",
            defaultValue = "1",
            requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer index = 1;
    
    /**
     * 每页数量
     */
    @NotNull(message = "每页数量不能为空")
    @Min(value = 1, message = "每页数量必须大于0")
    @Max(value = 100, message = "每页数量不能超过100")
    @Schema(description = "每页数量（默认20）",
            example = "20",
            defaultValue = "20",
            requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer count = 20;
    
    /**
     * 排序类型：1-热度排序，2-距离排序，4-评分排序
     */
    @Schema(description = "排序类型：1-热度排序，2-距离排序，4-评分排序",
            example = "2",
            defaultValue = "2",
            requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer sortType = 2; // 默认按距离排序
    
    /**
     * 最低评分筛选
     */
    @Schema(description = "最低评分筛选")
    private BigDecimal minScore;
    
    /**
     * 是否只看免费景点
     */
    @Schema(description = "是否只看免费景点",
            example = "false",
            defaultValue = "false",
            requiredMode = Schema.RequiredMode.REQUIRED)
    private Boolean freeOnly = false;
    
    /**
     * 景点等级筛选（如：5A、4A）
     */
    @Schema(description = "景点等级筛选（如：5A、4A）")
    private String sightLevel;
}